package cn.uway.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cn.uway.properties.CustomProperties;

@RequestMapping(value = "/test")
@RestController
public class TestController {
	
	  @Autowired
      private Environment environment;
	  
	  @Autowired
      private CustomProperties customProperties;

	  //测试   http://localhost:8090/test/printConfig?key=test.key
	  @RequestMapping(value = "/printConfig", method = RequestMethod.GET)
	  public String printConfig(String key) {	   
	      return environment.getProperty(key);
	  }
	  
	  
	  //测试  http://localhost:8090/test/printBeanConfig
	  @RequestMapping(value = "/printBeanConfig", method = RequestMethod.GET)
	  public String printBeanConfig() {	   
	      return customProperties.getInterfaceUrl();
	  }
	  
}
